//
//  FoodProjectCell.m
//  B段项目
//
//  Created by dllo on 15/11/9.
//  Copyright © 2015年 徐茂怀. All rights reserved.
//

#import "FoodProjectCell.h"
#import "FitHeader.h"
#import <UIImageView+WebCache.h>
@implementation FoodProjectCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _myImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_myImageView];
        
        _labelBackView = [[UIView alloc]init];
        [_myImageView addSubview:_labelBackView];
        
        _titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_titleLabel];
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    [_myImageView setFrame:CGRectMake(10 * FitWidth, 10 * FitHeight, self.frame.size.width - 20 * FitWidth, self.frame.size.height - 20 * FitHeight)];
    
    [_labelBackView setFrame:CGRectMake(0, CGRectGetHeight(_myImageView.frame) - 25 * FitHeight, CGRectGetWidth(_myImageView.frame), 25 * FitHeight)];
    _labelBackView.alpha = 0.3f;
    _labelBackView.backgroundColor = [UIColor blackColor];
    
    [_titleLabel setFrame:CGRectMake(20 * FitWidth, CGRectGetHeight(_myImageView.frame) - 15 * FitHeight, CGRectGetWidth(_myImageView.frame), 25 * FitHeight)];
    _titleLabel.textColor = [UIColor whiteColor];
}

//-(void)setFoodProjectModel:(FoodProjectModel *)foodProjectModel
//{
//    [_myImageView sd_setImageWithURL:[NSURL URLWithString:_foodProjectModel.thumb] placeholderImage:[UIImage imageNamed:@"老鼠"]];
//    _titleLabel.text = _foodProjectModel.title;
//}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
